diff --git a/templates/collection-post.tmpl b/templates/collection-post.tmpl
index 5baea38..818ec98 100644
--- a/templates/collection-post.tmpl
+++ b/templates/collection-post.tmpl
@@ -1,138 +1,128 @@
{{define "post"}}
{{.PlainDisplayTitle}} — {{.Collection.DisplayTitle}}
{{if gt .Views 1}}
{{end}}
{{if gt (len .Images) 0}}{{else}}{{end}}
{{range .Images}}{{else}}{{end}}
{{if .Collection.StyleSheet}}{{end}}
- {{if .Collection.RenderMathJax}}
-
- {{end}}
+ {{if .Collection.RenderMathJax}}
+
+ {{template "mathjax" . }}
+ {{end}}
{{template "highlighting" .}}
{{if .IsScheduled}}Scheduled
{{end}}{{if .Title.String}}{{.FormattedDisplayTitle}}
{{end}}{{.HTMLContent}}
{{ if .Collection.ShowFooterBranding }}
{{ end }}
{{if .Collection.CanShowScript}}
{{range .Collection.ExternalScripts}}{{end}}
{{if .Collection.Script}}{{end}}
{{end}}
{{end}}
diff --git a/templates/collection-tags.tmpl b/templates/collection-tags.tmpl
index e5c5fdc..fd37eed 100644
--- a/templates/collection-tags.tmpl
+++ b/templates/collection-tags.tmpl
@@ -1,203 +1,194 @@
{{define "collection-tags"}}
{{.Tag}} — {{.Collection.DisplayTitle}}
{{if not .Collection.IsPrivate}}{{end}}
{{if gt .Views 1}}
{{end}}
{{if .Collection.StyleSheet}}{{end}}
+
{{if .Collection.RenderMathJax}}
-
- {{end}}
+
+ {{template "mathjax" .}}
+ {{end}}
{{template "highlighting" . }}
{{if .Posts}}{{else}}{{end}}
{{.Tag}}
{{template "posts" .}}
{{if .Posts}}{{else}}{{end}}
{{ if .Collection.ShowFooterBranding }}
{{ end }}
{{if .CanShowScript}}
{{range .ExternalScripts}}{{end}}
{{if .Collection.Script}}{{end}}
{{end}}
{{if .IsOwner}}
{{end}}
{{end}}
diff --git a/templates/collection.tmpl b/templates/collection.tmpl
index 54f8b2f..b74b96c 100644
--- a/templates/collection.tmpl
+++ b/templates/collection.tmpl
@@ -1,239 +1,229 @@
{{define "collection"}}
{{.DisplayTitle}}{{if not .SingleUser}} — {{.SiteName}}{{end}}
{{if gt .CurrentPage 1}}{{end}}
{{if lt .CurrentPage .TotalPages}}{{end}}
{{if not .IsPrivate}}{{end}}
- {{if .StyleSheet}}{{end}}
- {{if .RenderMathJax}}
-
- {{end}}
+ {{if .StyleSheet}}{{end}}
+ {{if .RenderMathJax}}
+
+ {{template "mathjax" .}}
+ {{end}}
{{template "highlighting" . }}
{{if or .IsOwner .SingleUser}}{{end}}
{{if .Description}}{{.Description}}
{{end}}
{{/*if not .Public/*}}
{{/*end*/}}
{{if .PinnedPosts}}
{{end}}
{{if .Posts}}{{else}}{{end}}
{{if .ShowFooterBranding }}
{{ end }}
{{if .CanShowScript}}
{{range .ExternalScripts}}{{end}}
{{if .Script}}{{end}}
{{end}}
{{end}}
diff --git a/templates/include/render.tmpl b/templates/include/render.tmpl
index 5a0eb8e..4d7e545 100644
--- a/templates/include/render.tmpl
+++ b/templates/include/render.tmpl
@@ -1,14 +1,33 @@
{{define "highlighting"}}
-
+
{{end}}
+
+
+{{define "mathjax"}}
+
+
+{{end}}